{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "vscode": {
     "languageId": "shellscript"
    }
   },
   "outputs": [],
   "source": [
    "!pip3 install -r requirements.txt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 366,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[38;2;0;10;255m\u001b[0m \n",
      "\u001b[38;2;0;25;255m\u001b[0m \n",
      "\u001b[38;2;0;40;255m\u001b[0m \n",
      "\u001b[38;2;0;55;255m\u001b[0m \n",
      "\u001b[38;2;0;70;255m\u001b[0m \u001b[38;2;34;37;3m \u001b[0m\n",
      "\u001b[38;2;0;85;255m\u001b[0m \n",
      "\u001b[38;2;0;100;255m\u001b[0m \u001b[38;2;103;187;142m \u001b[0m\u001b[38;2;80;92;212m \u001b[0m\u001b[38;2;162;200;221m \u001b[0m\u001b[38;2;150;155;197m \u001b[0m\u001b[38;2;167;133;132m \u001b[0m\u001b[38;2;21;8;242m \u001b[0m\u001b[38;2;243;178;95m \u001b[0m\u001b[38;2;195;167;43m \u001b[0m\u001b[38;2;25;154;226m \u001b[0m\u001b[38;2;46;84;145m \u001b[0m\u001b[38;2;46;142;3m \u001b[0m\u001b[38;2;1;242;0m \u001b[0m\u001b[38;2;202;148;98m \u001b[0m\u001b[38;2;18;217;205m \u001b[0m\u001b[38;2;40;212;197m \u001b[0m\u001b[38;2;232;238;189m \u001b[0m\u001b[38;2;12;130;203m \u001b[0m\u001b[38;2;178;40;187m \u001b[0m\u001b[38;2;98;81;239m \u001b[0m\u001b[38;2;160;182;172m \u001b[0m\u001b[38;2;115;18;5m \u001b[0m\u001b[38;2;220;135;209m \u001b[0m\u001b[38;2;138;251;243m \u001b[0m\u001b[38;2;68;122;117m \u001b[0m\u001b[38;2;88;84;55m \u001b[0m\u001b[38;2;73;93;125m \u001b[0m\u001b[38;2;105;75;215m \u001b[0m\u001b[38;2;239;69;197m \u001b[0m\u001b[38;2;239;128;71m \u001b[0m\u001b[38;2;159;11;150m \u001b[0m\u001b[38;2;201;203;16m \u001b[0m\u001b[38;2;252;36;194m \u001b[0m\u001b[38;2;130;52;136m \u001b[0m\u001b[38;2;11;235;177m \u001b[0m\u001b[38;2;31;158;229m \u001b[0m\u001b[38;2;84;246;164m \u001b[0m\u001b[38;2;191;224;198m \u001b[0m\u001b[38;2;142;225;121m \u001b[0m\u001b[38;2;15;125;201m \u001b[0m\u001b[38;2;52;48;79m \u001b[0m\u001b[38;2;33;55;40m \u001b[0m\u001b[38;2;236;133;205m \u001b[0m\u001b[38;2;108;5;188m \u001b[0m\u001b[38;2;207;102;249m \u001b[0m\u001b[38;2;235;184;51m \u001b[0m\u001b[38;2;128;192;19m \u001b[0m\u001b[38;2;145;82;186m \u001b[0m\u001b[38;2;120;11;124m \u001b[0m\u001b[38;2;117;94;53m \u001b[0m\u001b[38;2;187;23;18m \u001b[0m\u001b[38;2;141;64;68m \u001b[0m\u001b[38;2;26;52;185m \u001b[0m\u001b[38;2;163;81;149m \u001b[0m\u001b[38;2;197;105;109m \u001b[0m\u001b[38;2;111;137;175m \u001b[0m\u001b[38;2;207;9;81m \u001b[0m\u001b[38;2;119;98;84m \u001b[0m\u001b[38;2;69;248;68m \u001b[0m\u001b[38;2;204;227;55m \u001b[0m\u001b[38;2;115;91;103m \u001b[0m\u001b[38;2;238;248;119m \u001b[0m\u001b[38;2;158;253;87m \u001b[0m\u001b[38;2;215;243;209m \u001b[0m\u001b[38;2;162;245;226m \u001b[0m\u001b[38;2;212;251;87m \u001b[0m\u001b[38;2;124;214;125m \u001b[0m\u001b[38;2;107;227;70m \u001b[0m\u001b[38;2;177;95;5m \u001b[0m\u001b[38;2;70;31;52m \u001b[0m\u001b[38;2;233;48;105m_\u001b[0m\u001b[38;2;129;185;204m_\u001b[0m\u001b[38;2;146;185;121m_\u001b[0m\u001b[38;2;174;255;205m_\u001b[0m\u001b[38;2;112;72;34m_\u001b[0m\u001b[38;2;124;207;73m_\u001b[0m\u001b[38;2;155;85;14m \u001b[0m\u001b[38;2;59;167;101m \u001b[0m\u001b[38;2;247;174;204m_\u001b[0m\u001b[38;2;65;233;241m_\u001b[0m\u001b[38;2;238;65;22m_\u001b[0m\u001b[38;2;156;107;209m_\u001b[0m\u001b[38;2;31;155;81m_\u001b[0m\u001b[38;2;187;132;13m_\u001b[0m\u001b[38;2;73;85;23m_\u001b[0m\u001b[38;2;168;247;91m \u001b[0m\u001b[38;2;155;165;185m \u001b[0m\u001b[38;2;81;102;121m_\u001b[0m\u001b[38;2;171;162;141m_\u001b[0m\u001b[38;2;249;95;125m_\u001b[0m\u001b[38;2;95;33;196m_\u001b[0m\u001b[38;2;205;23;87m_\u001b[0m\u001b[38;2;123;122;79m_\u001b[0m\u001b[38;2;196;184;156m_\u001b[0m\u001b[38;2;115;51;119m_\u001b[0m\u001b[38;2;144;17;3m \u001b[0m\n",
      "\u001b[38;2;0;115;255m \u001b[0m \u001b[38;2;50;6;207m \u001b[0m\u001b[38;2;89;251;53m \u001b[0m\u001b[38;2;219;90;114m \u001b[0m\u001b[38;2;141;78;41m \u001b[0m\u001b[38;2;198;153;153m \u001b[0m\u001b[38;2;153;249;112m \u001b[0m\u001b[38;2;227;186;250m \u001b[0m\u001b[38;2;248;206;113m \u001b[0m\u001b[38;2;245;29;184m \u001b[0m\u001b[38;2;40;197;10m \u001b[0m\u001b[38;2;182;214;98m \u001b[0m\u001b[38;2;24;48;188m \u001b[0m\u001b[38;2;155;168;34m \u001b[0m\u001b[38;2;237;163;129m \u001b[0m\u001b[38;2;219;54;198m \u001b[0m\u001b[38;2;43;176;73m \u001b[0m\u001b[38;2;236;242;91m \u001b[0m\u001b[38;2;210;157;20m \u001b[0m\u001b[38;2;91;79;147m \u001b[0m\u001b[38;2;236;207;174m \u001b[0m\u001b[38;2;207;22;125m \u001b[0m\u001b[38;2;41;191;79m \u001b[0m\u001b[38;2;100;51;180m \u001b[0m\u001b[38;2;133;178;181m \u001b[0m\u001b[38;2;150;85;127m \u001b[0m\u001b[38;2;166;179;171m \u001b[0m\u001b[38;2;89;166;172m \u001b[0m\u001b[38;2;78;44;59m \u001b[0m\u001b[38;2;134;111;101m \u001b[0m\u001b[38;2;250;252;245m \u001b[0m\u001b[38;2;191;245;102m \u001b[0m\u001b[38;2;170;0;169m \u001b[0m\u001b[38;2;43;31;18m \u001b[0m\u001b[38;2;107;16;159m \u001b[0m\u001b[38;2;29;48;121m \u001b[0m\u001b[38;2;60;226;129m \u001b[0m\u001b[38;2;56;215;106m \u001b[0m\u001b[38;2;206;61;2m \u001b[0m\u001b[38;2;137;151;59m \u001b[0m\u001b[38;2;110;220;34m \u001b[0m\u001b[38;2;34;222;219m \u001b[0m\u001b[38;2;23;229;100m \u001b[0m\u001b[38;2;243;203;93m \u001b[0m\u001b[38;2;31;59;158m \u001b[0m\u001b[38;2;177;216;95m \u001b[0m\u001b[38;2;60;226;236m \u001b[0m\u001b[38;2;118;186;207m \u001b[0m\u001b[38;2;19;12;80m \u001b[0m\u001b[38;2;55;21;103m \u001b[0m\u001b[38;2;170;174;230m \u001b[0m\u001b[38;2;255;172;253m \u001b[0m\u001b[38;2;240;162;79m \u001b[0m\u001b[38;2;222;104;224m \u001b[0m\u001b[38;2;197;169;54m \u001b[0m\u001b[38;2;40;248;92m \u001b[0m\u001b[38;2;141;153;249m \u001b[0m\u001b[38;2;217;210;64m \u001b[0m\u001b[38;2;65;13;233m \u001b[0m\u001b[38;2;251;107;62m \u001b[0m\u001b[38;2;50;66;184m \u001b[0m\u001b[38;2;143;181;160m \u001b[0m\u001b[38;2;157;66;150m \u001b[0m\u001b[38;2;16;28;204m \u001b[0m\u001b[38;2;36;26;130m \u001b[0m\u001b[38;2;226;175;153m \u001b[0m\u001b[38;2;19;98;161m \u001b[0m\u001b[38;2;32;196;231m \u001b[0m\u001b[38;2;246;87;187m/\u001b[0m\u001b[38;2;177;225;202m \u001b[0m\u001b[38;2;69;32;30m \u001b[0m\u001b[38;2;246;230;47m \u001b[0m\u001b[38;2;135;12;79m \u001b[0m\u001b[38;2;171;14;79m \u001b[0m\u001b[38;2;67;37;11m \u001b[0m\u001b[38;2;204;12;186m\\\u001b[0m\u001b[38;2;178;233;245m|\u001b[0m\u001b[38;2;58;36;237m \u001b[0m\u001b[38;2;119;196;90m \u001b[0m\u001b[38;2;12;39;122m \u001b[0m\u001b[38;2;193;220;195m \u001b[0m\u001b[38;2;55;24;74m \u001b[0m\u001b[38;2;159;79;103m \u001b[0m\u001b[38;2;153;98;133m \u001b[0m\u001b[38;2;134;135;22m\\\u001b[0m\u001b[38;2;149;235;42m|\u001b[0m\u001b[38;2;46;216;148m \u001b[0m\u001b[38;2;118;39;151m \u001b[0m\u001b[38;2;164;220;68m \u001b[0m\u001b[38;2;253;216;64m \u001b[0m\u001b[38;2;170;62;175m \u001b[0m\u001b[38;2;133;222;182m \u001b[0m\u001b[38;2;247;19;42m \u001b[0m\u001b[38;2;175;162;145m \u001b[0m\u001b[38;2;204;235;226m\\\u001b[0m\n",
      "\u001b[38;2;0;130;255m\u001b[0m \u001b[38;2;160;115;253m \u001b[0m\u001b[38;2;180;216;88m \u001b[0m\u001b[38;2;178;29;57m \u001b[0m\u001b[38;2;151;71;91m \u001b[0m\u001b[38;2;86;19;160m \u001b[0m\u001b[38;2;246;102;222m \u001b[0m\u001b[38;2;49;249;75m \u001b[0m\u001b[38;2;199;231;19m \u001b[0m\u001b[38;2;160;28;77m \u001b[0m\u001b[38;2;18;30;95m \u001b[0m\u001b[38;2;219;112;153m \u001b[0m\u001b[38;2;187;240;25m \u001b[0m\u001b[38;2;121;120;5m \u001b[0m\u001b[38;2;74;129;152m \u001b[0m\u001b[38;2;108;149;62m \u001b[0m\u001b[38;2;174;207;137m \u001b[0m\u001b[38;2;111;98;109m \u001b[0m\u001b[38;2;238;39;166m \u001b[0m\u001b[38;2;166;48;30m \u001b[0m\u001b[38;2;179;214;74m \u001b[0m\u001b[38;2;28;218;134m \u001b[0m\u001b[38;2;86;155;174m \u001b[0m\u001b[38;2;183;210;212m \u001b[0m\u001b[38;2;179;221;112m \u001b[0m\u001b[38;2;199;167;107m \u001b[0m\u001b[38;2;124;133;225m \u001b[0m\u001b[38;2;20;237;68m \u001b[0m\u001b[38;2;62;22;87m \u001b[0m\u001b[38;2;146;166;33m \u001b[0m\u001b[38;2;26;230;8m \u001b[0m\u001b[38;2;145;96;177m \u001b[0m\u001b[38;2;94;239;178m \u001b[0m\u001b[38;2;113;218;193m \u001b[0m\u001b[38;2;249;53;46m \u001b[0m\u001b[38;2;241;213;126m \u001b[0m\u001b[38;2;224;126;34m \u001b[0m\u001b[38;2;91;140;249m \u001b[0m\u001b[38;2;2;54;123m \u001b[0m\u001b[38;2;113;30;245m \u001b[0m\u001b[38;2;154;210;191m \u001b[0m\u001b[38;2;40;75;6m \u001b[0m\u001b[38;2;73;200;4m \u001b[0m\u001b[38;2;98;115;224m \u001b[0m\u001b[38;2;68;139;133m \u001b[0m\u001b[38;2;174;0;140m \u001b[0m\u001b[38;2;104;160;79m \u001b[0m\u001b[38;2;143;72;242m \u001b[0m\u001b[38;2;46;33;42m \u001b[0m\u001b[38;2;57;205;210m \u001b[0m\u001b[38;2;205;41;230m \u001b[0m\u001b[38;2;227;97;15m \u001b[0m\u001b[38;2;133;122;235m \u001b[0m\u001b[38;2;43;191;8m \u001b[0m\u001b[38;2;219;251;52m \u001b[0m\u001b[38;2;20;103;178m \u001b[0m\u001b[38;2;177;208;135m \u001b[0m\u001b[38;2;183;162;109m \u001b[0m\u001b[38;2;68;43;0m \u001b[0m\u001b[38;2;220;118;119m \u001b[0m\u001b[38;2;17;39;234m \u001b[0m\u001b[38;2;232;132;230m \u001b[0m\u001b[38;2;250;84;187m \u001b[0m\u001b[38;2;84;146;239m \u001b[0m\u001b[38;2;145;125;237m \u001b[0m\u001b[38;2;61;9;23m \u001b[0m\u001b[38;2;130;104;194m \u001b[0m\u001b[38;2;13;130;217m \u001b[0m\u001b[38;2;123;144;119m|\u001b[0m\u001b[38;2;67;172;126m \u001b[0m\u001b[38;2;175;115;12m \u001b[0m\u001b[38;2;241;188;205m▓\u001b[0m\u001b[38;2;231;110;166m▓\u001b[0m\u001b[38;2;222;64;17m▓\u001b[0m\u001b[38;2;115;194;189m▓\u001b[0m\u001b[38;2;78;122;40m▓\u001b[0m\u001b[38;2;52;214;194m▓\u001b[0m\u001b[38;2;74;19;253m\\\u001b[0m\u001b[38;2;68;243;168m \u001b[0m\u001b[38;2;179;35;70m▓\u001b[0m\u001b[38;2;88;31;15m▓\u001b[0m\u001b[38;2;212;79;190m▓\u001b[0m\u001b[38;2;45;140;230m▓\u001b[0m\u001b[38;2;165;71;212m▓\u001b[0m\u001b[38;2;119;247;199m▓\u001b[0m\u001b[38;2;14;235;195m▓\u001b[0m\u001b[38;2;33;174;240m\\\u001b[0m\u001b[38;2;102;137;145m\\\u001b[0m\u001b[38;2;142;199;48m▓\u001b[0m\u001b[38;2;69;28;250m▓\u001b[0m\u001b[38;2;190;46;5m▓\u001b[0m\u001b[38;2;96;179;85m▓\u001b[0m\u001b[38;2;63;83;194m▓\u001b[0m\u001b[38;2;39;50;106m▓\u001b[0m\u001b[38;2;151;55;153m▓\u001b[0m\u001b[38;2;158;135;14m▓\u001b[0m\n",
      "\u001b[38;2;0;145;255m\u001b[0m \u001b[38;2;1;215;242m \u001b[0m\u001b[38;2;22;35;31m \u001b[0m\u001b[38;2;156;161;136m \u001b[0m\u001b[38;2;237;242;61m \u001b[0m\u001b[38;2;60;104;74m \u001b[0m\u001b[38;2;243;185;226m \u001b[0m\u001b[38;2;54;60;52m \u001b[0m\u001b[38;2;92;52;91m \u001b[0m\u001b[38;2;109;164;245m \u001b[0m\u001b[38;2;154;175;142m \u001b[0m\u001b[38;2;78;250;220m \u001b[0m\u001b[38;2;66;86;131m \u001b[0m\u001b[38;2;6;55;50m \u001b[0m\u001b[38;2;209;209;234m \u001b[0m\u001b[38;2;195;81;237m \u001b[0m\u001b[38;2;1;221;19m \u001b[0m\u001b[38;2;108;85;120m \u001b[0m\u001b[38;2;216;90;42m \u001b[0m\u001b[38;2;235;3;38m \u001b[0m\u001b[38;2;199;153;118m \u001b[0m\u001b[38;2;185;112;103m \u001b[0m\u001b[38;2;64;179;254m \u001b[0m\u001b[38;2;159;199;166m \u001b[0m\u001b[38;2;62;146;97m \u001b[0m\u001b[38;2;35;200;100m \u001b[0m\u001b[38;2;183;199;61m \u001b[0m\u001b[38;2;114;223;91m \u001b[0m\u001b[38;2;28;63;152m \u001b[0m\u001b[38;2;212;156;130m \u001b[0m\u001b[38;2;236;30;68m \u001b[0m\u001b[38;2;153;7;192m \u001b[0m\u001b[38;2;195;241;215m \u001b[0m\u001b[38;2;4;79;218m \u001b[0m\u001b[38;2;86;132;9m \u001b[0m\u001b[38;2;94;88;203m \u001b[0m\u001b[38;2;78;3;141m \u001b[0m\u001b[38;2;54;15;3m \u001b[0m\u001b[38;2;247;8;97m \u001b[0m\u001b[38;2;124;135;151m \u001b[0m\u001b[38;2;162;195;98m \u001b[0m\u001b[38;2;254;235;110m \u001b[0m\u001b[38;2;80;125;18m \u001b[0m\u001b[38;2;55;19;80m \u001b[0m\u001b[38;2;28;142;194m \u001b[0m\u001b[38;2;226;133;153m \u001b[0m\u001b[38;2;13;49;36m \u001b[0m\u001b[38;2;237;48;99m \u001b[0m\u001b[38;2;122;131;145m \u001b[0m\u001b[38;2;11;121;71m \u001b[0m\u001b[38;2;191;115;45m \u001b[0m\u001b[38;2;10;230;22m \u001b[0m\u001b[38;2;196;205;69m \u001b[0m\u001b[38;2;103;55;9m \u001b[0m\u001b[38;2;177;104;75m \u001b[0m\u001b[38;2;117;112;124m \u001b[0m\u001b[38;2;207;237;60m \u001b[0m\u001b[38;2;60;77;56m \u001b[0m\u001b[38;2;53;74;180m \u001b[0m\u001b[38;2;25;166;59m \u001b[0m\u001b[38;2;147;51;187m \u001b[0m\u001b[38;2;73;183;187m \u001b[0m\u001b[38;2;59;132;17m \u001b[0m\u001b[38;2;99;170;54m \u001b[0m\u001b[38;2;81;87;158m \u001b[0m\u001b[38;2;46;123;229m \u001b[0m\u001b[38;2;146;97;187m \u001b[0m\u001b[38;2;158;176;168m \u001b[0m\u001b[38;2;139;152;5m|\u001b[0m\u001b[38;2;212;229;66m \u001b[0m\u001b[38;2;240;133;67m▓\u001b[0m\u001b[38;2;193;66;168m▓\u001b[0m\u001b[38;2;31;211;150m \u001b[0m\u001b[38;2;150;105;221m_\u001b[0m\u001b[38;2;134;181;255m_\u001b[0m\u001b[38;2;197;235;162m\\\u001b[0m\u001b[38;2;84;177;146m▓\u001b[0m\u001b[38;2;107;44;36m▓\u001b[0m\u001b[38;2;64;84;146m \u001b[0m\u001b[38;2;199;49;23m▓\u001b[0m\u001b[38;2;221;42;127m▓\u001b[0m\u001b[38;2;13;28;129m_\u001b[0m\u001b[38;2;141;177;33m_\u001b[0m\u001b[38;2;144;168;80m/\u001b[0m\u001b[38;2;97;208;110m \u001b[0m\u001b[38;2;126;107;120m▓\u001b[0m\u001b[38;2;83;42;185m▓\u001b[0m\u001b[38;2;253;194;145m \u001b[0m\u001b[38;2;173;144;27m \u001b[0m\u001b[38;2;217;79;12m|\u001b[0m\u001b[38;2;37;23;149m \u001b[0m\u001b[38;2;40;59;161m▓\u001b[0m\u001b[38;2;142;80;110m▓\u001b[0m\u001b[38;2;88;133;161m \u001b[0m\u001b[38;2;216;233;196m \u001b[0m\u001b[38;2;196;112;181m \u001b[0m\n",
      "\u001b[38;2;0;160;255m\u001b[0m \u001b[38;2;118;192;198m \u001b[0m\u001b[38;2;241;181;108m \u001b[0m\u001b[38;2;150;10;41m \u001b[0m\u001b[38;2;25;188;51m \u001b[0m\u001b[38;2;228;20;179m \u001b[0m\u001b[38;2;127;109;60m \u001b[0m\u001b[38;2;228;7;183m \u001b[0m\u001b[38;2;254;20;145m \u001b[0m\u001b[38;2;174;109;130m \u001b[0m\u001b[38;2;45;145;155m \u001b[0m\u001b[38;2;111;226;137m \u001b[0m\u001b[38;2;179;205;245m \u001b[0m\u001b[38;2;84;217;175m \u001b[0m\u001b[38;2;127;129;150m \u001b[0m\u001b[38;2;75;183;148m \u001b[0m\u001b[38;2;63;176;176m \u001b[0m\u001b[38;2;142;242;171m \u001b[0m\u001b[38;2;12;192;244m \u001b[0m\u001b[38;2;215;189;1m \u001b[0m\u001b[38;2;195;75;24m \u001b[0m\u001b[38;2;93;89;102m \u001b[0m\u001b[38;2;19;15;18m \u001b[0m\u001b[38;2;214;91;240m \u001b[0m\u001b[38;2;114;120;8m \u001b[0m\u001b[38;2;57;253;233m \u001b[0m\u001b[38;2;191;27;135m \u001b[0m\u001b[38;2;186;194;191m \u001b[0m\u001b[38;2;109;9;131m \u001b[0m\u001b[38;2;160;149;119m \u001b[0m\u001b[38;2;201;118;87m \u001b[0m\u001b[38;2;241;117;73m \u001b[0m\u001b[38;2;110;245;62m \u001b[0m\u001b[38;2;98;144;14m \u001b[0m\u001b[38;2;125;112;169m \u001b[0m\u001b[38;2;71;121;254m \u001b[0m\u001b[38;2;64;109;198m \u001b[0m\u001b[38;2;16;156;166m \u001b[0m\u001b[38;2;216;91;41m \u001b[0m\u001b[38;2;97;153;169m \u001b[0m\u001b[38;2;210;225;127m \u001b[0m\u001b[38;2;125;11;61m \u001b[0m\u001b[38;2;171;210;77m \u001b[0m\u001b[38;2;192;76;205m \u001b[0m\u001b[38;2;63;19;153m \u001b[0m\u001b[38;2;192;78;45m \u001b[0m\u001b[38;2;169;131;130m \u001b[0m\u001b[38;2;167;211;135m \u001b[0m\u001b[38;2;202;142;182m \u001b[0m\u001b[38;2;210;103;90m \u001b[0m\u001b[38;2;173;171;247m \u001b[0m\u001b[38;2;22;240;221m \u001b[0m\u001b[38;2;81;93;41m \u001b[0m\u001b[38;2;36;73;172m \u001b[0m\u001b[38;2;138;232;185m \u001b[0m\u001b[38;2;240;85;78m \u001b[0m\u001b[38;2;95;182;15m \u001b[0m\u001b[38;2;136;0;202m \u001b[0m\u001b[38;2;29;114;97m \u001b[0m\u001b[38;2;74;81;217m \u001b[0m\u001b[38;2;178;218;204m \u001b[0m\u001b[38;2;176;208;62m \u001b[0m\u001b[38;2;125;32;180m \u001b[0m\u001b[38;2;38;175;79m \u001b[0m\u001b[38;2;252;163;201m \u001b[0m\u001b[38;2;196;93;237m \u001b[0m\u001b[38;2;230;40;217m \u001b[0m\u001b[38;2;248;59;85m \u001b[0m\u001b[38;2;92;19;88m|\u001b[0m\u001b[38;2;104;145;104m \u001b[0m\u001b[38;2;70;210;54m▓\u001b[0m\u001b[38;2;106;96;54m▓\u001b[0m\u001b[38;2;181;204;219m|\u001b[0m\u001b[38;2;176;35;31m \u001b[0m\u001b[38;2;231;7;108m \u001b[0m\u001b[38;2;215;68;121m \u001b[0m\u001b[38;2;159;42;223m \u001b[0m\u001b[38;2;20;210;222m\\\u001b[0m\u001b[38;2;118;203;35m \u001b[0m\u001b[38;2;75;141;99m▓\u001b[0m\u001b[38;2;188;82;195m▓\u001b[0m\u001b[38;2;81;156;96m \u001b[0m\u001b[38;2;238;34;247m \u001b[0m\u001b[38;2;110;113;5m \u001b[0m\u001b[38;2;196;95;82m \u001b[0m\u001b[38;2;222;241;107m▓\u001b[0m\u001b[38;2;185;59;156m▓\u001b[0m\u001b[38;2;29;88;163m \u001b[0m\u001b[38;2;138;66;160m \u001b[0m\u001b[38;2;213;109;35m|\u001b[0m\u001b[38;2;195;161;232m \u001b[0m\u001b[38;2;12;221;10m▓\u001b[0m\u001b[38;2;57;17;176m▓\u001b[0m\u001b[38;2;167;207;74m \u001b[0m\u001b[38;2;102;200;149m \u001b[0m\u001b[38;2;146;239;36m \u001b[0m\n",
      "\u001b[38;2;0;175;255m          |¯¯¯¯| |¯¯¯¯| '/¯¯¯/.\\¯¯¯\\‚ '/¯¯¯¯/\\¯¯¯¯\\  |¯¯¯¯| |¯¯¯¯|\u001b[0m \u001b[38;2;166;66;119m \u001b[0m\u001b[38;2;173;220;227m|\u001b[0m\u001b[38;2;159;171;63m \u001b[0m\u001b[38;2;158;17;175m▓\u001b[0m\u001b[38;2;223;73;251m▓\u001b[0m\u001b[38;2;75;55;252m \u001b[0m\u001b[38;2;176;187;219m\\\u001b[0m\u001b[38;2;157;117;35m▓\u001b[0m\u001b[38;2;97;248;233m▓\u001b[0m\u001b[38;2;241;44;156m▓\u001b[0m\u001b[38;2;222;108;179m▓\u001b[0m\u001b[38;2;84;134;38m \u001b[0m\u001b[38;2;38;62;45m▓\u001b[0m\u001b[38;2;240;237;250m▓\u001b[0m\u001b[38;2;47;62;166m▓\u001b[0m\u001b[38;2;90;1;148m▓\u001b[0m\u001b[38;2;26;114;79m▓\u001b[0m\u001b[38;2;173;121;155m▓\u001b[0m\u001b[38;2;206;163;134m▓\u001b[0m\u001b[38;2;236;22;15m \u001b[0m\u001b[38;2;18;161;211m \u001b[0m\u001b[38;2;218;137;32m \u001b[0m\u001b[38;2;3;240;117m|\u001b[0m\u001b[38;2;225;121;152m \u001b[0m\u001b[38;2;193;189;243m▓\u001b[0m\u001b[38;2;248;15;17m▓\u001b[0m\u001b[38;2;7;229;173m \u001b[0m\u001b[38;2;70;253;111m \u001b[0m\u001b[38;2;150;153;235m \u001b[0m\n",
      "\u001b[38;2;0;190;255m          |:·.·|_|:·.·| |:·.·|_|:·.·| |:·.·|  |____| |:·.·|./____/ \u001b[0m \u001b[38;2;178;127;23m|\u001b[0m\u001b[38;2;192;100;143m \u001b[0m\u001b[38;2;146;62;112m▓\u001b[0m\u001b[38;2;239;206;243m▓\u001b[0m\u001b[38;2;160;170;208m_\u001b[0m\u001b[38;2;90;119;237m_\u001b[0m\u001b[38;2;184;47;165m|\u001b[0m\u001b[38;2;147;76;137m \u001b[0m\u001b[38;2;20;208;167m▓\u001b[0m\u001b[38;2;207;68;18m▓\u001b[0m\u001b[38;2;15;71;6m \u001b[0m\u001b[38;2;42;179;73m▓\u001b[0m\u001b[38;2;244;192;84m▓\u001b[0m\u001b[38;2;32;100;48m \u001b[0m\u001b[38;2;157;154;30m \u001b[0m\u001b[38;2;131;159;255m \u001b[0m\u001b[38;2;187;106;64m \u001b[0m\u001b[38;2;65;238;119m \u001b[0m\u001b[38;2;165;181;40m \u001b[0m\u001b[38;2;189;45;75m \u001b[0m\u001b[38;2;69;149;46m \u001b[0m\u001b[38;2;39;70;51m|\u001b[0m\u001b[38;2;209;12;66m \u001b[0m\u001b[38;2;127;255;181m▓\u001b[0m\u001b[38;2;201;59;62m▓\u001b[0m\u001b[38;2;109;218;121m \u001b[0m\u001b[38;2;162;171;89m \u001b[0m\u001b[38;2;15;241;112m \u001b[0m\n",
      "\u001b[38;2;0;205;255m          |:·.·|¯|:·.·| |:·.·|¯|:·.·| |:·.·|__|¯¯¯¯| |:·.·|.\\¯¯¯¯\\ \u001b[0m \u001b[38;2;24;116;100m \u001b[0m\u001b[38;2;0;249;156m\\\u001b[0m\u001b[38;2;21;23;153m▓\u001b[0m\u001b[38;2;112;85;151m▓\u001b[0m\u001b[38;2;150;181;250m \u001b[0m\u001b[38;2;121;169;45m \u001b[0m\u001b[38;2;173;33;72m \u001b[0m\u001b[38;2;67;131;121m \u001b[0m\u001b[38;2;159;71;67m▓\u001b[0m\u001b[38;2;16;120;203m▓\u001b[0m\u001b[38;2;199;110;34m \u001b[0m\u001b[38;2;205;2;21m▓\u001b[0m\u001b[38;2;106;100;229m▓\u001b[0m\u001b[38;2;118;184;50m \u001b[0m\u001b[38;2;1;253;9m \u001b[0m\u001b[38;2;13;126;195m \u001b[0m\u001b[38;2;156;223;238m \u001b[0m\u001b[38;2;69;70;229m \u001b[0m\u001b[38;2;64;52;28m \u001b[0m\u001b[38;2;188;225;180m \u001b[0m\u001b[38;2;235;241;239m \u001b[0m\u001b[38;2;129;111;34m|\u001b[0m\u001b[38;2;51;66;233m \u001b[0m\u001b[38;2;218;252;159m▓\u001b[0m\u001b[38;2;55;253;184m▓\u001b[0m\u001b[38;2;59;250;181m \u001b[0m\n",
      "\u001b[38;2;0;220;255m          |____| |____| |____|:|____|  \\__ _\\/____/  |____| |_____|\u001b[0m \u001b[38;2;207;144;163m \u001b[0m\u001b[38;2;100;145;232m \u001b[0m\u001b[38;2;109;161;152m\\\u001b[0m\u001b[38;2;149;72;143m▓\u001b[0m\u001b[38;2;141;13;255m▓\u001b[0m\u001b[38;2;185;249;40m▓\u001b[0m\u001b[38;2;202;166;110m▓\u001b[0m\u001b[38;2;71;11;121m▓\u001b[0m\u001b[38;2;5;94;181m▓\u001b[0m\u001b[38;2;123;81;147m \u001b[0m\u001b[38;2;198;85;6m\\\u001b[0m\u001b[38;2;81;43;54m▓\u001b[0m\u001b[38;2;45;92;112m▓\u001b[0m\u001b[38;2;44;207;28m \u001b[0m\u001b[38;2;182;49;106m \u001b[0m\u001b[38;2;216;199;129m \u001b[0m\u001b[38;2;99;45;231m \u001b[0m\u001b[38;2;35;194;14m \u001b[0m\u001b[38;2;26;155;123m \u001b[0m\u001b[38;2;255;62;104m \u001b[0m\u001b[38;2;144;17;107m \u001b[0m\u001b[38;2;114;99;63m \u001b[0m\u001b[38;2;213;126;93m\\\u001b[0m\u001b[38;2;188;111;229m▓\u001b[0m\u001b[38;2;144;78;241m▓\u001b[0m\n",
      "\u001b[38;2;0;0;0m\u001b[0m\n",
      "\u001b[38;2;20;20;20m        ╔─────────────────────────────-= hackGPT Notebook =-─────────────────── ¤ ◎ ¤ ──────╗\u001b[0m\n",
      "\u001b[38;2;40;40;40m        ║  ┌¤───────────────────────────────────┬────────────────────────Requirements───┐   ║ \u001b[0m\n",
      "\u001b[38;2;60;60;60m        ╚──│  Format......: hax                 │  Payloads.........: /input/           │───╝  \u001b[0m\n",
      "\u001b[38;2;80;80;80m           │  Date........: Nov 11,1999         │  API Token......: [********--] .env   │\u001b[0m\n",
      "\u001b[38;2;100;100;100m           ╚────────────────────────────────────┴───────────────────────────────────────╝\u001b[0m\n",
      "\u001b[38;2;120;120;120m                                                                                                  \u001b[0m\n",
      "\n"
     ]
    }
   ],
   "source": [
    "#hackGPT banner\n",
    "import fade\n",
    "\n",
    "hack=  \"\\n\"*7 + r\"\"\" \n",
    "\n",
    "\n",
    "\n",
    "          |¯¯¯¯| |¯¯¯¯| '/¯¯¯/.\\¯¯¯\\‚ '/¯¯¯¯/\\¯¯¯¯\\  |¯¯¯¯| |¯¯¯¯|\n",
    "          |:·.·|_|:·.·| |:·.·|_|:·.·| |:·.·|  |____| |:·.·|./____/ \n",
    "          |:·.·|¯|:·.·| |:·.·|¯|:·.·| |:·.·|__|¯¯¯¯| |:·.·|.\\¯¯¯¯\\ \n",
    "          |____| |____| |____|:|____|  \\__ _\\/____/  |____| |_____|\n",
    "  \n",
    "\n",
    "                                                                  \"\"\" + \"\\n\"*12\n",
    "\n",
    "gpt = \"\\n\"*4 +r\"\"\" \n",
    "\n",
    "                                                                     ______  _______  ________ \n",
    "                                                                   /      \\|       \\|        \\\n",
    "                                                                   |  ▓▓▓▓▓▓\\ ▓▓▓▓▓▓▓\\\\▓▓▓▓▓▓▓▓\n",
    "                                                                   | ▓▓ __\\▓▓ ▓▓__/ ▓▓  | ▓▓   \n",
    "                                                                   | ▓▓|    \\ ▓▓    ▓▓  | ▓▓   \n",
    " | ▓▓ \\▓▓▓▓ ▓▓▓▓▓▓▓   | ▓▓   \n",
    "| ▓▓__| ▓▓ ▓▓        | ▓▓   \n",
    " \\▓▓    ▓▓ ▓▓        | ▓▓ \n",
    "  \\▓▓▓▓▓▓ \\▓▓         \\▓▓\"\"\"                                                                                                 \n",
    "nfo =  r\"\"\"\n",
    "        ╔─────────────────────────────-= hackGPT Notebook =-─────────────────── ¤ ◎ ¤ ──────╗\n",
    "        ║  ┌¤───────────────────────────────────┬────────────────────────Requirements───┐   ║ \n",
    "        ╚──│  Format......: hax                 │  Payloads.........: /input/           │───╝  \n",
    "           │  Date........: Nov 11,1999         │  API Token......: [********--] .env   │\n",
    "           ╚────────────────────────────────────┴───────────────────────────────────────╝\n",
    "                                                                                                  \"\"\"\n",
    "\n",
    "fadedhack = fade.water(hack)\n",
    "fadedgpt = fade.random(gpt)\n",
    "fadednfo = fade.blackwhite(nfo)\n",
    "for pair in zip(*map(str.splitlines, (fadedhack, fadedgpt))): \n",
    "  print(*pair)\n",
    "print(fadednfo)        \n",
    "                            \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#OpenAI API Setup\n",
    "from dotenv import load_dotenv\n",
    "import os\n",
    "import fade\n",
    "from pathlib import Path\n",
    "import openai\n",
    "import tweepy\n",
    "# Load API key from an environment variable or secret management service\n",
    "\n",
    "load_dotenv(\".env\")  \n",
    "apiToken = os.environ.get('OPENAI_TOKEN')\n",
    "openai.api_key = apiToken\n",
    "API_KEY = os.getenv('twitter_api_key')\n",
    "API_SECRET = os.getenv('twitter_api_secret')\n",
    "ACCESS_TOKEN = os.getenv('twitter_access_token')\n",
    "TOKEN_SECRET = os.getenv('twitter_token_secret')\n",
    "\n",
    "if 'OPENAI_TOKEN' in os.environ:\n",
    "   pass\n",
    "else:\n",
    "   error='''           \n",
    "                     *   )           )            (   \n",
    "                     `(     ( /((        (  (      )\\   \n",
    "                      )\\(   )\\())\\  (    )\\))(  ((((_) \n",
    "                     ((_)\\ (_))((_) )\\ ) ((   ))\\  )\\) \n",
    "                     8\"\"\"\" 8\"\"\"8  8\"\"\"8  8\"\"\"88 8\"\"\"8  \n",
    "                     8     8   8  8   8  8    8 8   8  \n",
    "                     8eeee 8eee8e 8eee8e 8    8 8eee8e \n",
    "                     88    88   8 88   8 8    8 88   8 \n",
    "                     88    88   8 88   8 8    8 88   8 \n",
    "                     88eee 88   8 88   8 8eeee8 88   8 \n",
    "                                  \n",
    "   \\033[1;33mAttempting to Set OpenAI system variable with API key.\n",
    "\n",
    "                      \\033[0;37mExample: \\033[40m$ 𝚎𝚡𝚙𝚘𝚛𝚝 OPENAI_TOKEN=\"𝙰𝙸 𝚃𝚘𝚔𝚎𝚗\"\n",
    "                      \\033[0;37mSee sample \\033[40m.𝚎𝚗𝚟\\033[0;37m file for formating.'''\n",
    "\n",
    "\n",
    "   fadederror = fade.fire(error)\n",
    "   print(fadederror)\n",
    "   Path(\".env\").touch()\n",
    "   setting_token = open(\".env\", \"a\")\n",
    "   userkey = input('Enter OpenAI API Key: ').replace(\" \",\"\")\n",
    "   setting_token.write(\"OPENAI_TOKEN=\"+'\"'+userkey+'\"\\n')\n",
    "   #print(\"API Setup Complete... continue to next step\")\n",
    "if 'twitter_api_key' in os.environ:\n",
    "   pass\n",
    "else:\n",
    "   print(\"Set Twitter creds\") \n",
    "   Path(\".env\").touch()\n",
    "   setting_token = open(\".env\", \"a\")\n",
    "   userkey = input('twitter_api_key: ').replace(\" \",\"\")\n",
    "   setting_token.write(\"twitter_api_key=\"+'\"'+userkey+'\"\\n')\n",
    "   userkey = input('twitter_api_secret: ').replace(\" \",\"\")\n",
    "   setting_token.write(\"twitter_api_secret=\"+'\"'+userkey+'\"\\n')  \n",
    "   userkey = input('twitter_access_token ').replace(\" \",\"\")\n",
    "   setting_token.write(\"twitter_access_token=\"+'\"'+userkey+'\"\\n')\n",
    "   userkey = input('twitter_token_secret: ').replace(\" \",\"\")\n",
    "   setting_token.write(\"twitter_token_secret=\"+'\"'+userkey+'\"')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Single Lookups\n",
    "import os\n",
    "import openai\n",
    "import json\n",
    "import fade\n",
    "from dotenv import load_dotenv\n",
    "load_dotenv(\".env\")  \n",
    "apiToken = os.environ.get('OPENAI_TOKEN')\n",
    "openai.api_key = apiToken\n",
    "payload = open(\"input/malware/malware_sample\", \"r\").readlines()\n",
    "payload = str(payload)\n",
    "response = openai.Completion.create(\n",
    "  model=\"code-davinci-002\",\n",
    "  prompt=payload+\"\\nHere's your loot:\\n\",\n",
    "  temperature=0,\n",
    "  max_tokens=64,\n",
    "  top_p=1,\n",
    "  frequency_penalty=0,\n",
    "  presence_penalty=0,\n",
    "  stop=[\"\\\"\\\"\\\"\"]\n",
    ")\n",
    "response = response['choices'][0]['text']\n",
    "fadedresponse = fade.greenblue(response)\n",
    "\n",
    "\n",
    "data_payload = \"input/code\"\n",
    "search = open(data_payload ,\"r\")\n",
    "#with open(\"datafile\") as myfile:\n",
    "head = [next(search) for x in range(15)]\n",
    "head = fade.purpleblue(str(head))\n",
    "\n",
    "\n",
    "fadedsearch =r\"\"\"\n",
    "                                         \n",
    "                  _____     _____          _____   ______         _____    ____ \n",
    "              ___|\\    \\   |\\    \\   _____|\\    \\ |\\     \\    ___|\\    \\  |    |\n",
    "             |    |\\    \\  | |    | /    /|\\\\    \\| \\     \\  /    /\\    \\ |    |\n",
    "             |    | |    | \\/     / |    || \\|    \\  \\     ||    |  |    ||    |\n",
    "             |    |/____/| /     /_  \\   \\/  |     \\  |    ||    |__|    ||    |\n",
    "             |    ||    |||     // \\  \\   \\  |      \\ |    ||    .--.    ||    |\n",
    "             |    ||____|/|    |/   \\ |    | |    |\\ \\|    ||    |  |    ||    |\n",
    "             |____|       |\\ ___/\\   \\|   /| |____||\\_____/||____|  |____||____|\n",
    "             |    |       | |   | \\______/ | |    |/ \\|   |||    |  |    ||    |\n",
    "             |____|        \\|___|/\\ |    | | |____|   |___|/|____|  |____||____|\n",
    "               \\(             \\(   \\|____|/    \\(       )/    \\(      )/    \\(  \n",
    "                '              '      )/        '       '      '      '      '  \n",
    "                                      '        \n",
    "─ ──+──── ──  ─   ────────────────────────────────────────────────────────   ─  ── ────+── ─\n",
    " \"\"\" \n",
    "                                                     \n",
    "tookewl=fade.purplepink(fadedsearch)\n",
    "print(tookewl)\n",
    "\n",
    "\n",
    "print(\"\\033[36msearching OpenAI for:\\n\")\n",
    "print(\"[snip]\\n\"+head+\"[snip]\")\n",
    "seperator = \"─ ──+──── ──  ─   ────────────────────────────────────────────────────────   ─  ── ────+── ─\"\n",
    "faded_seperator = fade.water(seperator)\n",
    "print(faded_seperator)\n",
    "fadedresponse = fade.greenblue(\"1.\"+response)\n",
    "print(' '*39+\"🆁🅴🆂🆄🅻🆃🆂\\n\" + \"𝘚𝘦𝘢𝘳𝘤𝘩 𝘴𝘰𝘶𝘳𝘤𝘦 𝘪𝘯𝘱𝘶𝘵:\"+ data_payload)\n",
    "print(\"\\n\\033[36mHere's what I think this code is doing:\")\n",
    "print(fadedresponse)\n",
    "print(faded_seperator)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Bulk OpenAI Search\n",
    "#!/usr/bin/env python3\n",
    "# -*- coding: utf-8 -*-\n",
    "import fade\n",
    "import json\n",
    "import requests\n",
    "import urllib.parse\n",
    "import urllib.request\n",
    "import argparse\n",
    "import sys\n",
    "import os\n",
    "import json\n",
    "import csv\n",
    "import shutil\n",
    "from os import path\n",
    "from shutil import make_archive\n",
    "from directory_structure import Tree\n",
    "from alive_progress import alive_bar\n",
    "import time\n",
    "import openai\n",
    "from dotenv import load_dotenv\n",
    "load_dotenv()  \n",
    "apiToken = os.environ.get(\"OPENAI_TOKEN\")\n",
    "headers = {\n",
    "                    \"Accept\": \"application/json; charset=utf-8\",\n",
    "                    \"Authorization\": \"Token\" + str(apiToken)\n",
    "                }\n",
    "targets = \"input/sample_sources\"\n",
    "\n",
    "search = open(targets ,\"r\")\n",
    "query = search.read()\n",
    "hack=  \"\\n\"*7 + r\"\"\" \n",
    "\n",
    "\n",
    "\n",
    "          |¯¯¯¯| |¯¯¯¯| '/¯¯¯/.\\¯¯¯\\‚ '/¯¯¯¯/\\¯¯¯¯\\  |¯¯¯¯| |¯¯¯¯|\n",
    "          |:·.·|_|:·.·| |:·.·|_|:·.·| |:·.·|  |____| |:·.·|./____/ \n",
    "          |:·.·|¯|:·.·| |:·.·|¯|:·.·| |:·.·|__|¯¯¯¯| |:·.·|.\\¯¯¯¯\\ \n",
    "          |____| |____| |____|:|____|  \\__ _\\/____/  |____| |_____|\n",
    "  ─ ──+──── ──  ─   ────────────────────────────────────────────────────────   ─  ── ────+── ─\n",
    "\n",
    "                                                                  \"\"\" + \"\\n\"*12\n",
    "\n",
    "gpt = \"\\n\"*4 +r\"\"\" \n",
    "\n",
    "                                                                     ______  _______  ________ \n",
    "                                                                   /      \\|       \\|        \\\n",
    "                                                                   |  ▓▓▓▓▓▓\\ ▓▓▓▓▓▓▓\\\\▓▓▓▓▓▓▓▓\n",
    "                                                                   | ▓▓ __\\▓▓ ▓▓__/ ▓▓  | ▓▓   \n",
    "                                                                   | ▓▓|    \\ ▓▓    ▓▓  | ▓▓   \n",
    " | ▓▓ \\▓▓▓▓ ▓▓▓▓▓▓▓   | ▓▓   \n",
    "| ▓▓__| ▓▓ ▓▓        | ▓▓   \n",
    " \\▓▓    ▓▓ ▓▓        | ▓▓ \n",
    "  \\▓▓▓▓▓▓ \\▓▓         \\▓▓\"\"\"                                                                                                 \n",
    "nfo =  r\"\"\"\n",
    "\n",
    "                                                                                                  \"\"\"\n",
    "\n",
    "fadedhack = fade.water(hack)\n",
    "fadedgpt = fade.random(gpt)\n",
    "fadednfo = fade.blackwhite(nfo)\n",
    "for pair in zip(*map(str.splitlines, (fadedhack, fadedgpt))): \n",
    "  print(*pair)\n",
    "\n",
    "\n",
    "query_parse = json.dumps(query.split(\"\\n\"), sort_keys=True, indent=4)\n",
    "print(\"\\033[36msearching OpenAI for\")\n",
    "print(query_parse)\n",
    "seperator = \"─ ──+──── ──  ─   ────────────────────────────────────────────────────────   ─  ── ────+── ─\"\n",
    "faded_seperator = fade.water(seperator)\n",
    "print(faded_seperator)\n",
    "openai_targets = []\n",
    "\n",
    "if 'OPENAI_TOKEN' in os.environ:\n",
    "    pass\n",
    "else:\n",
    "    os.environ['OPENAI_TOKEN'] = input('Enter API Key: ').replace(\" \",\"\")\n",
    "investigation = input(\"Enter name for your investigation: \")\n",
    "f_jsonpath = 'output/'+investigation+'/results'\n",
    "token = os.environ.get(\"OPENAI_TOKEN\")\n",
    "\n",
    "os.mkdir('output/'+investigation)\n",
    "os.mkdir('output/'+investigation+'/results/')\n",
    "\n",
    "with open(targets, 'r') as targets:\n",
    "    for line in targets:\n",
    "        openai_targets.append(line)\n",
    "        \n",
    "    \n",
    "    for search in openai_targets:\n",
    "        #search = search.strip()\n",
    "        response = openai.Completion.create(\n",
    "        model=\"text-davinci-003\",\n",
    "        prompt=search+\"\\n\\n\",\n",
    "        temperature=0,\n",
    "        max_tokens=3000,\n",
    "        top_p=1,\n",
    "        frequency_penalty=0,\n",
    "        presence_penalty=0,\n",
    "        stop=[\"\\\"\\\"\\\"\"]\n",
    "        )\n",
    "        response = response['choices'][0]['text']\n",
    "        with open('output/'+investigation+'/results/'+str(search.rsplit('/', 1)[-1])+ \".txt\", \"w\") as f:\n",
    "            f.write(response)\n",
    "        fadedresponse = fade.greenblue(\"1.\"+response)\n",
    "\n",
    "        print(' '*39+\"🆁🅴🆂🆄🅻🆃🆂\\n\" + \"𝘚𝘦𝘢𝘳𝘤𝘩 𝘴𝘰𝘶𝘳𝘤𝘦 𝘪𝘯𝘱𝘶𝘵:\"+ str(search).strip())\n",
    "        print(\"\\n\\033[36mHere's your code! \")\n",
    "        print(fadedresponse)\n",
    "        print(faded_seperator)\n",
    "        \n",
    "\n",
    "\n",
    "path = Tree(f_jsonpath, absolute=False)\n",
    "print(path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[38;2;40;0;220m\u001b[0m\n",
      "\u001b[38;2;55;0;220m                                         \u001b[0m\n",
      "\u001b[38;2;70;0;220m                  _____     _____          _____   ______         _____    ____ \u001b[0m\n",
      "\u001b[38;2;85;0;220m              ___|\\    \\   |\\    \\   _____|\\    \\ |\\     \\    ___|\\    \\  |    |\u001b[0m\n",
      "\u001b[38;2;100;0;220m             |    |\\    \\  | |    | /    /|\\\\    \\| \\     \\  /    /\\    \\ |    |\u001b[0m\n",
      "\u001b[38;2;115;0;220m             |    | |    | \\/     / |    || \\|    \\  \\     ||    |  |    ||    |\u001b[0m\n",
      "\u001b[38;2;130;0;220m             |    |/____/| /     /_  \\   \\/  |     \\  |    ||    |__|    ||    |\u001b[0m\n",
      "\u001b[38;2;145;0;220m             |    ||    |||     // \\  \\   \\  |      \\ |    ||    .--.    ||    |\u001b[0m\n",
      "\u001b[38;2;160;0;220m             |    ||____|/|    |/   \\ |    | |    |\\ \\|    ||    |  |    ||    |\u001b[0m\n",
      "\u001b[38;2;175;0;220m             |____|       |\\ ___/\\   \\|   /| |____||\\_____/||____|  |____||____|\u001b[0m\n",
      "\u001b[38;2;190;0;220m             |    |       | |   | \\______/ | |    |/ \\|   |||    |  |    ||    |\u001b[0m\n",
      "\u001b[38;2;205;0;220m             |____|        \\|___|/\\ |    | | |____|   |___|/|____|  |____||____|\u001b[0m\n",
      "\u001b[38;2;220;0;220m               \\(             \\(   \\|____|/    \\(       )/    \\(      )/    \\(  \u001b[0m\n",
      "\u001b[38;2;235;0;220m                '              '      )/        '       '      '      '      '  \u001b[0m\n",
      "\u001b[38;2;250;0;220m                                      '        \u001b[0m\n",
      "\u001b[38;2;255;0;220m─ ──+──── ──  ─   ────────────────────────────────────────────────────────   ─  ── ────+── ─\u001b[0m\n",
      "\u001b[38;2;255;0;220m \u001b[0m\n",
      "\n",
      "\u001b[36msearching twitter for\n",
      "[\n",
      "    \"#hacking\"\n",
      "]\n",
      "\u001b[38;2;0;10;255m─ ──+──── ──  ─   ────────────────────────────────────────────────────────   ─  ── ────+── ─\u001b[0m\n",
      "\n",
      "                                       🆁🅴🆂🆄🅻🆃🆂\n",
      "𝘚𝘦𝘢𝘳𝘤𝘩 𝘴𝘰𝘶𝘳𝘤𝘦 𝘪𝘯𝘱𝘶𝘵:If your Gmail account got Hacked, text me now for guide on how to recover your account immediately #gmailhack… https://t.co/hcOLT4sX0m\n",
      "\u001b[36mHere's what I think these tweets mean:\n",
      "\u001b[38;2;0;255;100m It's like your car got stolen and you need help finding it - text me now for a guide on how to get it back quickly. #carstolen\u001b[0m\n",
      "\n",
      "\u001b[38;2;0;10;255m─ ──+──── ──  ─   ────────────────────────────────────────────────────────   ─  ── ────+── ─\u001b[0m\n",
      "\n"
     ]
    }
   ],
   "source": [
    "#Twitter Search ChatGPT tweeter\n",
    "#!/usr/bin/env python3\n",
    "# -*- coding: utf-8 -*-\n",
    "import fade\n",
    "import tweepy\n",
    "import json\n",
    "import requests\n",
    "import urllib.parse\n",
    "import urllib.request\n",
    "import argparse\n",
    "import sys\n",
    "import os\n",
    "import json\n",
    "import csv\n",
    "import shutil\n",
    "from os import path\n",
    "from shutil import make_archive\n",
    "from directory_structure import Tree\n",
    "from alive_progress import alive_bar\n",
    "import time\n",
    "from time import time, sleep\n",
    "from datetime import date\n",
    "import openai\n",
    "from dotenv import load_dotenv\n",
    "load_dotenv()  \n",
    "openai.api_key= os.environ.get(\"OPENAI_TOKEN\")\n",
    "apiToken = os.environ.get(\"OPENAI_TOKEN\")\n",
    "API_KEY = os.getenv('twitter_api_key')\n",
    "API_SECRET = os.getenv('twitter_api_secret')\n",
    "ACCESS_TOKEN = os.getenv('twitter_access_token')\n",
    "TOKEN_SECRET = os.getenv('twitter_token_secret')\n",
    "auth = tweepy.OAuthHandler(str(API_KEY), str(API_SECRET))\n",
    "auth.set_access_token(str(ACCESS_TOKEN), str(TOKEN_SECRET))\n",
    "\n",
    "targets = \"input/twitter\"\n",
    "date_since = date.today()\n",
    "numtweets = 5 \n",
    "\n",
    "search = open(targets ,\"r\")\n",
    "query = search.read()\n",
    "fadedsearch =r\"\"\"\n",
    "                                         \n",
    "                  _____     _____          _____   ______         _____    ____ \n",
    "              ___|\\    \\   |\\    \\   _____|\\    \\ |\\     \\    ___|\\    \\  |    |\n",
    "             |    |\\    \\  | |    | /    /|\\\\    \\| \\     \\  /    /\\    \\ |    |\n",
    "             |    | |    | \\/     / |    || \\|    \\  \\     ||    |  |    ||    |\n",
    "             |    |/____/| /     /_  \\   \\/  |     \\  |    ||    |__|    ||    |\n",
    "             |    ||    |||     // \\  \\   \\  |      \\ |    ||    .--.    ||    |\n",
    "             |    ||____|/|    |/   \\ |    | |    |\\ \\|    ||    |  |    ||    |\n",
    "             |____|       |\\ ___/\\   \\|   /| |____||\\_____/||____|  |____||____|\n",
    "             |    |       | |   | \\______/ | |    |/ \\|   |||    |  |    ||    |\n",
    "             |____|        \\|___|/\\ |    | | |____|   |___|/|____|  |____||____|\n",
    "               \\(             \\(   \\|____|/    \\(       )/    \\(      )/    \\(  \n",
    "                '              '      )/        '       '      '      '      '  \n",
    "                                      '        \n",
    "─ ──+──── ──  ─   ────────────────────────────────────────────────────────   ─  ── ────+── ─\n",
    " \"\"\" \n",
    "                                                     \n",
    "tookewl=fade.purplepink(fadedsearch)\n",
    "print(tookewl)\n",
    "\n",
    "query_parse = json.dumps(query.split(\"\\n\"), sort_keys=True, indent=4)\n",
    "print(\"\\033[36msearching twitter for\")\n",
    "print(query_parse)\n",
    "seperator = \"─ ──+──── ──  ─   ────────────────────────────────────────────────────────   ─  ── ────+── ─\"\n",
    "faded_seperator = fade.water(seperator)\n",
    "print(faded_seperator)\n",
    "openai_targets = []\n",
    "tweets = []\n",
    "if 'OPENAI_TOKEN' in os.environ:\n",
    "    pass\n",
    "else:\n",
    "    os.environ['OPENAI_TOKEN'] = input('Enter OpenAI API Key: ').replace(\" \",\"\")\n",
    "#investigation = input(\"Enter name for your investigation: \")\n",
    "#f_jsonpath = 'output/'+investigation+'/results'\n",
    "token = os.environ.get(\"OPENAI_TOKEN\")\n",
    "\n",
    "#os.mkdir('output/'+investigation)\n",
    "#os.mkdir('output/'+investigation+'/results/')\n",
    "\n",
    "headers = {\n",
    "                    \"Accept\": \"application/json; charset=utf-8\",\n",
    "                    \"Authorization\": \"Token\" + apiToken\n",
    "                }\n",
    "\n",
    "with open(targets, 'r') as targets:\n",
    "    \n",
    "    for line in targets:\n",
    "        openai_targets.append(line)\n",
    "\n",
    "    api = tweepy.API(auth, wait_on_rate_limit = True)\n",
    "    starttime = time()    \n",
    "    for tweet in api.search_tweets(q = openai_targets, count = numtweets, lang = \"en\", until = date_since):\n",
    "        tweets.append(tweet.text)\n",
    "                #try:\n",
    "        #print(tweets)    \n",
    "        #api.update_status(\n",
    "                #status=\"This tweet was generated by #PwnAI #ChatGPT:\",\n",
    "                #in_reply_to_status_id=tweet.id,\n",
    "                #)\n",
    "    for search in tweets:\n",
    "        #search = search.strip()\n",
    "        response = openai.Completion.create(\n",
    "  model=\"text-davinci-003\",\n",
    "  prompt=\"\\nCreate an analogy for this phrase:\"+search+\"\\n1.\",\n",
    "  temperature=0.5,\n",
    "  max_tokens=60,\n",
    "  top_p=1,\n",
    "  frequency_penalty=0,\n",
    "  presence_penalty=0\n",
    ")\n",
    "        response = response['choices'][0]['text']\n",
    "        #with open('output/'+investigation+'/results/'+str(search.rsplit('/', 1)[-1])+ \".txt\", \"w\") as f:\n",
    "        #    f.write(response)\n",
    "        fadedresponse = fade.greenblue(response)\n",
    "        api.update_status(\n",
    "            status=\"Generated by #PwnAI #ChatGPT: I searched for #hacking & found a guide to help, I think it means: - \"+response)\n",
    "        print(' '*39+\"🆁🅴🆂🆄🅻🆃🆂\\n\" + \"𝘚𝘦𝘢𝘳𝘤𝘩 𝘴𝘰𝘶𝘳𝘤𝘦 𝘪𝘯𝘱𝘶𝘵:\"+ str(search).strip('\\n\\n'))\n",
    "        print(\"\\033[36mHere's what I think these tweets mean:\")\n",
    "        print(fadedresponse)\n",
    "        print(faded_seperator)\n",
    "        \n",
    "        \n",
    "                #api.update_status(\n",
    "                #status=\"Please reach us via DM\",\n",
    "                #in_reply_to_status_id=tweet.id,\n",
    "                #)\n",
    "                # #tweet.retweet()\n",
    "                #print(tweet.retweet())\n",
    "                #except:\n",
    "                #print(e.reason)\n",
    "                    #break # Only retweet the first one\n",
    "            #sleep(60.0 - ((time() - starttime) % 60.0))    \n",
    "\n",
    "\n",
    "#path = Tree(f_jsonpath, absolute=False)\n",
    "#print(path)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.6"
  },
  "vscode": {
   "interpreter": {
    "hash": "20bf69066c0dd38d51965b69d5e1b6e387082e3198ba56e97997ac55f4e50ad0"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
